Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat / WCAG validation per page using axe-playwright #192

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

langemike
Copy link

@langemike langemike commented Apr 29, 2024

Description

With this PR, we now perform a WCAG check per page using axe-playwright.

Due to these accessibility tests, new issues have been found and fixed:

  1. aria-rowindex and aria-colindex should start with 1 according to the docs (docs)
  2. The featured shelf was missing a (hidden) h2, which made the header order illogical (Axe DevTools extension couldn't detect this one)
  3. The role img was missing on the lock icon in VideoListItem
  4. A label element was missing for the Select component
  5. The heading hierarchy is fixed on the Search page

Update June 4th: Temporary wait functions are necessary (sadly)

The accessibility tests always fail on the first run, but succeed on all subsequent runs (e.g. when you locally rerun, they always pass).

It looks like we need to implement proper page load handling and find an alternative to the temporary I.wait() in our accessibility tests . It appears that the I.waitForLoaderDone() function is not sufficient to address the issue in all tests, therefore we resorted to a wait function for now as a temporary fix (I've created a ticket for this research: OTT-1884)

Update June 5th

🚧 Work in Progress: Tests still fail after implementing a wait of 2 seconds in the checkA11y function. We need to further investigate and find a solution, see Slack thread for more info: Thread.


Original ticket: https://videodock.atlassian.net/browse/OTT-1134
Other tickets that are solved, see userstory: OTT-1593

Solely run the a11y tests

Change codecept start script to:

"codecept:desktop": "cd test-e2e && rm -rf \"./output/desktop\" && codeceptjs run --config ./codecept.desktop.cjs"

Change test config to only run a11y tests:

tests: ['./tests/**/*.js', './tests/**/accessibility_test.ts'],

For a more verbose output, add logging to if (impactedViolations.length > 0) check:

console.dir(impactedViolations, { depth: null });

@langemike langemike temporarily deployed to Deployment Previews April 29, 2024 15:39 — with GitHub Actions Inactive
@langemike langemike changed the title Feat / WCAG validation per page using `axe-playwright (POC) Feat / WCAG validation per page using axe-playwright (POC) Apr 29, 2024
@langemike langemike changed the title Feat / WCAG validation per page using axe-playwright (POC) Feat / WCAG validation per page using axe-playwright May 2, 2024
@langemike langemike temporarily deployed to Deployment Previews May 26, 2024 11:24 — with GitHub Actions Inactive
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews May 30, 2024 14:38 — with GitHub Actions Inactive
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews May 30, 2024 15:52 — with GitHub Actions Inactive
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews June 4, 2024 14:36 — with GitHub Actions Inactive
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews June 4, 2024 20:12 — with GitHub Actions Inactive
@MelissaDTH MelissaDTH temporarily deployed to Deployment Previews June 5, 2024 09:16 — with GitHub Actions Inactive

Scenario('WCAG compliant - Choose Offer Modal', async ({ I }) => {
I.useConfig(testConfigs.svod);
paidLoginContext = await I.registerOrLogin(paidLoginContext);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a weird convention. I also see this is not your idea, but it is used like this in other tests. Is this really needed to make it work? I have the assumption it could be left empty and still work.

Also, I would move the let within the scope of this scenario.

Scenario('WCAG compliant - Player Page', async ({ I }) => {
I.useConfig(testConfigs.basicNoAuth);
I.amOnPage('/m/awWEFyPu/big-buck-bunny?r=dGSUzs9o&play=1');
I.checkA11y();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazingly no failures for the player!? Awesome!

@langemike
Copy link
Author

@ChristiaanScheermeijer maybe we should push this through next sprint and submit it as a PR in the OSS repo. Even without e2e tests for some of the modals (there is still an open ticket for that). It is beneficial to have this in the OSS repo so nobody accidentally breaks accessibility.

If @MelissaDTH is back on Monday, maybe she could finish off this PR and do some of the modals later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants